﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SqlSugar;
using VOL.Entity.DomainModels;
using Yitter.IdGenerator;

namespace Base.Write.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class BaseWriteController : ControllerBase
    {
        private readonly ISqlSugarClient _db;

        public BaseWriteController(ISqlSugarClient db)
        {
            _db = db;
        }
        /// <summary>
        /// 测试1
        /// </summary>
        /// <returns></returns>
        [HttpPost("AddwareHouse")]
        public bool AddwareHouse()
        {
            wareHouse wareHouse = new wareHouse();
            wareHouse.wareHouseId=YitIdHelper.NextId().ToString();
            wareHouse.wareHouseName = "一号仓库";
            wareHouse.wareHouseAddr = "北京市";
            wareHouse.wareHouseLeaseTime=DateTime.Now;
            return _db.Insertable(wareHouse).ExecuteCommand()>0;

        }

    }
}
